/**********************************************************
 * MailingSystemAction.java.java
 * Created by Ashutosh
 * Last modified Date: Sep 18, 2008 10:48:31 AM by Ashutosh
 * Revision: <svn revision #>
 * Version : 0.1
 * Copyright (c) 2008 - 2009 cyberThink Infotech Pvt. Ltd., All rights reserved.
 **********************************************************/

package com.printeverywhere.action;

import org.apache.log4j.Logger;

import com.printeverywhere.delegator.MailingSystemServiceDelegator;
import com.printeverywhere.dto.MailingSystem;

/**
 * The Class MailingSystemAction.
 */
public class MailingSystemAction extends AdminSystemSetup {

	/** Logger for this class. */
	private static final Logger logger = Logger.getLogger(MailingSystemAction.class);

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** The mailing system. */
	private MailingSystem mailingSystem;

	/**
	 * Gets the mailing system.
	 *
	 * @return the mailing system
	 */
	public MailingSystem getMailingSystem() {
		return mailingSystem;
	}

	/**
	 * Sets the mailing system.
	 *
	 * @param mailingSystem the new mailing system
	 */
	public void setMailingSystem(MailingSystem mailingSystem) {
		this.mailingSystem = mailingSystem;
	}

	/**
	 * Show mailing system.
	 *
	 * @return the string
	 */
	public String showMailingSystem() {
		if (logger.isDebugEnabled()) {
			logger.debug("showMailingSystem() - start"); //$NON-NLS-1$
		}

		this.mailingSystem = MailingSystemServiceDelegator.getMailingSystem();

		if (logger.isDebugEnabled()) {
			logger.debug("showMailingSystem() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update mailing system.
	 *
	 * @return the string
	 */
	public String updateMailingSystem() {
		if (logger.isDebugEnabled()) {
			logger.debug("updateMailingSystem() - start"); //$NON-NLS-1$
		}

		MailingSystemServiceDelegator.updateMailingSystem(mailingSystem);

		if (logger.isDebugEnabled()) {
			logger.debug("updateMailingSystem() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}
}